package com.hzqy.persistence.dao.epg;


import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.activity.ActivityVoteUserVo;


@Repository
public class HappyDao extends PersistenceDao<CmContentVo, Integer> {

	public int selectHappyCount(Map<String, Object> map) {
		return getSqlSession().selectOne(this.getNamespace()+"selectHappyCount",map);
	}
	
	public List<CmContentVo> selectHappyList(Map<String, Object> map){
		return getSqlSession().selectList(this.getNamespace()+"selectHappyList",map);
	}

	public int selectSumVotenum(ActivityVoteUserVo avu) {
		Object selectOne = getSqlSession().selectOne(this.getNamespace()+"selectSumVotenum",avu);
		if (selectOne==null) {
			return 0;
		}else {
			return (int)selectOne;
		}
	}
	
	public int insertVoteUser(ActivityVoteUserVo acvote) {
		return getSqlSession().insert(this.getNamespace() +"insertVoteUser", acvote);
	}
	
	public int selectContentId(Map<String,Object> map) {
		Object selectOne =  getSqlSession().selectOne(this.getNamespace()+"selectContentId",map);
		if (selectOne==null) {
			return 0;
		}else {
			return (int)selectOne;
		}
	}
	
	
}
